Integrand size = 22, antiderivative size = 54 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=-\frac {d (c+d x) \cot (a+b x)}{b^2}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}+\frac {d^2 \log (\sin (a+b x))}{b^3} \]
Result contains complex when optimal does not.
Time = 1.06 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.74 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\frac {2 i b d^2 x-2 i d^2 \arctan (\tan (a+b x))-2 b d^2 x \cot (a)-b^2 (c+d x)^2 \csc ^2(a+b x)+d^2 \log \left (\sin ^2(a+b x)\right )+2 b d (c+d x) \csc (a) \csc (a+b x) \sin (b x)}{2 b^3} \]
((2*I)*b*d^2*x - (2*I)*d^2*ArcTan[Tan[a + b*x]] - 2*b*d^2*x*Cot[a] - b^2*( c + d*x)^2*Csc[a + b*x]^2 + d^2*Log[Sin[a + b*x]^2] + 2*b*d*(c + d*x)*Csc[ a]*Csc[a + b*x]*Sin[b*x])/(2*b^3)
Time = 0.35 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.09, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4910, 3042, 4672, 3042, 25, 3956}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 4910 |
\(\displaystyle \frac {d \int (c+d x) \csc ^2(a+b x)dx}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d \int (c+d x) \csc (a+b x)^2dx}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
\(\Big \downarrow \) 4672 |
\(\displaystyle \frac {d \left (\frac {d \int \cot (a+b x)dx}{b}-\frac {(c+d x) \cot (a+b x)}{b}\right )}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d \left (\frac {d \int -\tan \left (a+b x+\frac {\pi }{2}\right )dx}{b}-\frac {(c+d x) \cot (a+b x)}{b}\right )}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {d \left (-\frac {d \int \tan \left (\frac {1}{2} (2 a+\pi )+b x\right )dx}{b}-\frac {(c+d x) \cot (a+b x)}{b}\right )}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {d \left (\frac {d \log (-\sin (a+b x))}{b^2}-\frac {(c+d x) \cot (a+b x)}{b}\right )}{b}-\frac {(c+d x)^2 \csc ^2(a+b x)}{2 b}\) |
-1/2*((c + d*x)^2*Csc[a + b*x]^2)/b + (d*(-(((c + d*x)*Cot[a + b*x])/b) + (d*Log[-Sin[a + b*x]])/b^2))/b
3.1.48.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp [(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1) *Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Int[Cot[(a_.) + (b_.)*(x_)]^(p_.)*Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d _.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Csc[a + b*x]^n/(b*n)), x ] + Simp[d*(m/(b*n)) Int[(c + d*x)^(m - 1)*Csc[a + b*x]^n, x], x] /; Free Q[{a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(135\) vs. \(2(52)=104\).
Time = 1.31 (sec) , antiderivative size = 136, normalized size of antiderivative = 2.52
method | result | size |
parallelrisch | \(\frac {-8 \ln \left (\sec \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) d^{2}+8 \ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )\right ) d^{2}-b \left (b \left (d x +c \right )^{2} \cot \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}+\left (4 d^{2} x +4 c d \right ) \cot \left (\frac {a}{2}+\frac {x b}{2}\right )+b \left (d x +c \right )^{2} \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}+\left (-4 d^{2} x -4 c d \right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )+4 b \left (\frac {d x}{2}+c \right ) x d \right )}{8 b^{3}}\) | \(136\) |
risch | \(-\frac {2 i d^{2} x}{b^{2}}-\frac {2 i d^{2} a}{b^{3}}+\frac {2 b \,d^{2} x^{2} {\mathrm e}^{2 i \left (x b +a \right )}+4 b c d x \,{\mathrm e}^{2 i \left (x b +a \right )}+2 b \,c^{2} {\mathrm e}^{2 i \left (x b +a \right )}-2 i d^{2} x \,{\mathrm e}^{2 i \left (x b +a \right )}-2 i c d \,{\mathrm e}^{2 i \left (x b +a \right )}+2 i d^{2} x +2 i d c}{b^{2} \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{2}}+\frac {d^{2} \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )}{b^{3}}\) | \(148\) |
derivativedivides | \(\frac {-\frac {a^{2} d^{2}}{2 b^{2} \sin \left (x b +a \right )^{2}}+\frac {a c d}{b \sin \left (x b +a \right )^{2}}-\frac {2 a \,d^{2} \left (-\frac {x b +a}{2 \sin \left (x b +a \right )^{2}}-\frac {\cot \left (x b +a \right )}{2}\right )}{b^{2}}-\frac {c^{2}}{2 \sin \left (x b +a \right )^{2}}+\frac {2 c d \left (-\frac {x b +a}{2 \sin \left (x b +a \right )^{2}}-\frac {\cot \left (x b +a \right )}{2}\right )}{b}+\frac {d^{2} \left (-\frac {\left (x b +a \right )^{2}}{2 \sin \left (x b +a \right )^{2}}-\left (x b +a \right ) \cot \left (x b +a \right )+\ln \left (\sin \left (x b +a \right )\right )\right )}{b^{2}}}{b}\) | \(162\) |
default | \(\frac {-\frac {a^{2} d^{2}}{2 b^{2} \sin \left (x b +a \right )^{2}}+\frac {a c d}{b \sin \left (x b +a \right )^{2}}-\frac {2 a \,d^{2} \left (-\frac {x b +a}{2 \sin \left (x b +a \right )^{2}}-\frac {\cot \left (x b +a \right )}{2}\right )}{b^{2}}-\frac {c^{2}}{2 \sin \left (x b +a \right )^{2}}+\frac {2 c d \left (-\frac {x b +a}{2 \sin \left (x b +a \right )^{2}}-\frac {\cot \left (x b +a \right )}{2}\right )}{b}+\frac {d^{2} \left (-\frac {\left (x b +a \right )^{2}}{2 \sin \left (x b +a \right )^{2}}-\left (x b +a \right ) \cot \left (x b +a \right )+\ln \left (\sin \left (x b +a \right )\right )\right )}{b^{2}}}{b}\) | \(162\) |
norman | \(\frac {-\frac {c^{2}}{8 b}-\frac {c^{2} \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4}}{8 b}-\frac {d^{2} x^{2}}{8 b}-\frac {c d \tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{2 b^{2}}+\frac {c d \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}}{2 b^{2}}-\frac {c d x}{4 b}-\frac {d^{2} x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{2 b^{2}}+\frac {d^{2} x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}}{2 b^{2}}-\frac {d^{2} x^{2} \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{4 b}-\frac {d^{2} x^{2} \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4}}{8 b}-\frac {c d x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{2 b}-\frac {c d x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4}}{4 b}}{\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}+\frac {d^{2} \ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )\right )}{b^{3}}-\frac {d^{2} \ln \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )}{b^{3}}\) | \(254\) |
1/8*(-8*ln(sec(1/2*a+1/2*x*b)^2)*d^2+8*ln(tan(1/2*a+1/2*x*b))*d^2-b*(b*(d* x+c)^2*cot(1/2*a+1/2*x*b)^2+(4*d^2*x+4*c*d)*cot(1/2*a+1/2*x*b)+b*(d*x+c)^2 *tan(1/2*a+1/2*x*b)^2+(-4*d^2*x-4*c*d)*tan(1/2*a+1/2*x*b)+4*b*(1/2*d*x+c)* x*d))/b^3
Time = 0.27 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.89 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + 2 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 2 \, {\left (d^{2} \cos \left (b x + a\right )^{2} - d^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (b x + a\right )\right )}{2 \, {\left (b^{3} \cos \left (b x + a\right )^{2} - b^{3}\right )}} \]
1/2*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 + 2*(b*d^2*x + b*c*d)*cos(b*x + a )*sin(b*x + a) + 2*(d^2*cos(b*x + a)^2 - d^2)*log(1/2*sin(b*x + a)))/(b^3* cos(b*x + a)^2 - b^3)
\[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\int \left (c + d x\right )^{2} \cos {\left (a + b x \right )} \csc ^{3}{\left (a + b x \right )}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 1130 vs. \(2 (52) = 104\).
Time = 0.29 (sec) , antiderivative size = 1130, normalized size of antiderivative = 20.93 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\text {Too large to display} \]
1/2*(4*(4*(b*x + a)*cos(2*b*x + 2*a)^2 + 4*(b*x + a)*sin(2*b*x + 2*a)^2 - (2*(b*x + a)*cos(2*b*x + 2*a) + sin(2*b*x + 2*a))*cos(4*b*x + 4*a) - 2*(b* x + a)*cos(2*b*x + 2*a) - (2*(b*x + a)*sin(2*b*x + 2*a) - cos(2*b*x + 2*a) + 1)*sin(4*b*x + 4*a) + sin(2*b*x + 2*a))*c*d/((2*(2*cos(2*b*x + 2*a) - 1 )*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4 *cos(2*b*x + 2*a) - 1)*b) - 4*(4*(b*x + a)*cos(2*b*x + 2*a)^2 + 4*(b*x + a )*sin(2*b*x + 2*a)^2 - (2*(b*x + a)*cos(2*b*x + 2*a) + sin(2*b*x + 2*a))*c os(4*b*x + 4*a) - 2*(b*x + a)*cos(2*b*x + 2*a) - (2*(b*x + a)*sin(2*b*x + 2*a) - cos(2*b*x + 2*a) + 1)*sin(4*b*x + 4*a) + sin(2*b*x + 2*a))*a*d^2/(( 2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2 *b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*b^2) + (8*(b*x + a)^2*cos( 2*b*x + 2*a)^2 + 8*(b*x + a)^2*sin(2*b*x + 2*a)^2 - 4*(b*x + a)^2*cos(2*b* x + 2*a) - 4*((b*x + a)^2*cos(2*b*x + 2*a) + (b*x + a)*sin(2*b*x + 2*a))*c os(4*b*x + 4*a) + (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a) *sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*log(cos (b*x + a)^2 + sin(b*x + a)^2 + 2*cos(b*x + a) + 1) + (2*(2*cos(2*b*x + 2*a ) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - s...
Leaf count of result is larger than twice the leaf count of optimal. 2978 vs. \(2 (52) = 104\).
Time = 1.21 (sec) , antiderivative size = 2978, normalized size of antiderivative = 55.15 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\text {Too large to display} \]
-1/8*(b^2*d^2*x^2*tan(1/2*b*x)^4*tan(1/2*a)^4 + 2*b^2*c*d*x*tan(1/2*b*x)^4 *tan(1/2*a)^4 + 2*b^2*d^2*x^2*tan(1/2*b*x)^4*tan(1/2*a)^2 + 2*b^2*d^2*x^2* tan(1/2*b*x)^2*tan(1/2*a)^4 + b^2*c^2*tan(1/2*b*x)^4*tan(1/2*a)^4 + 4*b^2* c*d*x*tan(1/2*b*x)^4*tan(1/2*a)^2 - 4*b*d^2*x*tan(1/2*b*x)^4*tan(1/2*a)^3 + 4*b^2*c*d*x*tan(1/2*b*x)^2*tan(1/2*a)^4 - 4*b*d^2*x*tan(1/2*b*x)^3*tan(1 /2*a)^4 + b^2*d^2*x^2*tan(1/2*b*x)^4 + 4*b^2*d^2*x^2*tan(1/2*b*x)^2*tan(1/ 2*a)^2 + 2*b^2*c^2*tan(1/2*b*x)^4*tan(1/2*a)^2 - 4*b*c*d*tan(1/2*b*x)^4*ta n(1/2*a)^3 + b^2*d^2*x^2*tan(1/2*a)^4 + 2*b^2*c^2*tan(1/2*b*x)^2*tan(1/2*a )^4 - 4*b*c*d*tan(1/2*b*x)^3*tan(1/2*a)^4 + 2*b^2*c*d*x*tan(1/2*b*x)^4 + 4 *b*d^2*x*tan(1/2*b*x)^4*tan(1/2*a) + 8*b^2*c*d*x*tan(1/2*b*x)^2*tan(1/2*a) ^2 + 24*b*d^2*x*tan(1/2*b*x)^3*tan(1/2*a)^2 - 4*d^2*log(16*(tan(1/2*b*x)^4 *tan(1/2*a)^2 + 2*tan(1/2*b*x)^3*tan(1/2*a)^3 + tan(1/2*b*x)^2*tan(1/2*a)^ 4 - 2*tan(1/2*b*x)^3*tan(1/2*a) - 4*tan(1/2*b*x)^2*tan(1/2*a)^2 - 2*tan(1/ 2*b*x)*tan(1/2*a)^3 + tan(1/2*b*x)^2 + 2*tan(1/2*b*x)*tan(1/2*a) + tan(1/2 *a)^2)/(tan(1/2*b*x)^4*tan(1/2*a)^4 + 2*tan(1/2*b*x)^4*tan(1/2*a)^2 + 2*ta n(1/2*b*x)^2*tan(1/2*a)^4 + tan(1/2*b*x)^4 + 4*tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*a)^4 + 2*tan(1/2*b*x)^2 + 2*tan(1/2*a)^2 + 1))*tan(1/2*b*x)^4*t an(1/2*a)^2 + 24*b*d^2*x*tan(1/2*b*x)^2*tan(1/2*a)^3 - 8*d^2*log(16*(tan(1 /2*b*x)^4*tan(1/2*a)^2 + 2*tan(1/2*b*x)^3*tan(1/2*a)^3 + tan(1/2*b*x)^2*ta n(1/2*a)^4 - 2*tan(1/2*b*x)^3*tan(1/2*a) - 4*tan(1/2*b*x)^2*tan(1/2*a)^...
Time = 25.39 (sec) , antiderivative size = 147, normalized size of antiderivative = 2.72 \[ \int (c+d x)^2 \cot (a+b x) \csc ^2(a+b x) \, dx=\frac {\frac {{\left (c+d\,x\right )}^2}{b}+\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\,{\left (c+d\,x\right )}^2}{b}}{1+{\mathrm {e}}^{a\,4{}\mathrm {i}+b\,x\,4{}\mathrm {i}}-2\,{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}}-\frac {d^2\,x\,2{}\mathrm {i}}{b^2}+\frac {b\,c^2+2\,b\,c\,d\,x-c\,d\,2{}\mathrm {i}+b\,d^2\,x^2-d^2\,x\,2{}\mathrm {i}}{b^2\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}-1\right )}+\frac {d^2\,\ln \left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,2{}\mathrm {i}}-1\right )}{b^3} \]